<!--
 * @Author: MengjieYang yangmengjie@eolink.com
 * @Date: 2022-09-21 22:19:44
 * @LastEditors: MengjieYang yangmengjie@eolink.com
 * @LastEditTime: 2022-09-21 23:12:03
 * @FilePath: /apinto/projects/eo-ng-apinto-user/src/lib/component/user-profile/user-profile.component.html
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<form
  nz-form
  nzLayout="horizontal"
  [formGroup]="validateForm"
  [nzAutoTips]="autoTips"
  [nzNoColon]="true"
  #ngForm="ngForm"
  autocomplete="off"
>
  <nz-form-item>
    <nz-form-label [nzSpan]="6" nzRequired>账号：</nz-form-label>
    <nz-form-control [nzSpan]="13" [nzErrorTip]="nameErrorTpl">
      <input
        class="w-INPUT_NORMAL"
        eo-ng-input
        formControlName="userName"
        placeholder="英文数字下划线任意一种，首字母必须为英文"
        [disabled]="type !== 'addUser' || nzDisabled"
      />

      <ng-template #nameErrorTpl let-control>
        <ng-container *ngIf="control.hasError('pattern')"
          >英文数字下划线任意一种，首字母必须为英文</ng-container
        >
        <ng-container *ngIf="control.hasError('required')"
          >必填项</ng-container
        ></ng-template
      >
    </nz-form-control>
  </nz-form-item>

  <nz-form-item>
    <nz-form-label [nzSpan]="6" nzRequired>名称：</nz-form-label>
    <nz-form-control [nzSpan]="13">
      <input
        class="w-INPUT_NORMAL"
        eo-ng-input
        formControlName="nickName"
        placeholder="请输入名称"
      />
    </nz-form-control>
  </nz-form-item>

  <nz-form-item>
    <nz-form-label [nzSpan]="6" nzRequired>邮箱：</nz-form-label>
    <nz-form-control [nzSpan]="13">
      <input
        class="w-INPUT_NORMAL"
        eo-ng-input
        formControlName="email"
        placeholder="请输入邮箱"
      />
    </nz-form-control>
  </nz-form-item>

  <nz-form-item>
    <nz-form-label [nzSpan]="6">通知用户ID：</nz-form-label>
    <nz-form-control [nzSpan]="13">
      <input
        class="w-INPUT_NORMAL"
        eo-ng-input
        formControlName="noticeUserId"
        placeholder="请输入"
      />
    </nz-form-control>
  </nz-form-item>

  <nz-form-item *ngIf="type !== 'editCurrentUser'">
    <nz-form-label [nzSpan]="6">角色：</nz-form-label>
    <nz-form-control [nzSpan]="13">
      <eo-ng-select
        class="w-INPUT_NORMAL"
        [nzOptions]="rolesList"
        formControlName="role"
        nzPlaceHolder="请选择"
        [nzDisabled]="type === 'editCurrentUser'"
      ></eo-ng-select>
    </nz-form-control>
  </nz-form-item>

  <nz-form-item class="mb-0">
    <nz-form-label [nzSpan]="6">描述：</nz-form-label>
    <nz-form-control [nzSpan]="13">
      <textarea
        class="w-INPUT_NORMAL"
        eo-ng-input
        formControlName="desc"
        placeholder="请输入"
      ></textarea>
    </nz-form-control>
  </nz-form-item>
</form>
